package file;

import java.io.File;
import java.io.FileFilter;

public class Test {
    public static void main(String[] args) {
        File file = new File("./src/file");
        File[] files = file.listFiles(new FileFilter() {
            @Override
            public boolean accept(File pathname) {
                return pathname.getName().contains("D");
            }
        });
        System.out.println(files.length);
        for (int i = 0; i < files.length; i++) {
            System.out.println(files[i].getName());
        }
    }
}
